package com.tencent.qplus.paddata.stat;

import java.io.UnsupportedEncodingException;
import java.util.Date;

import com.tencent.qplus.paddata.util.ConfigUtil;
import com.tencent.qplus.paddata.util.MailPerson;
import com.tencent.qplus.paddata.util.MailUtils;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		System.out.println(new Date());
		testMail();
		//testConfig();
	}

	public static void testConfig(){
		
		String[] serverKeys = ConfigUtil.getString("total_logservers").split(";");
		for(String s:serverKeys){
			String logFilePath = ConfigUtil.getString("logfile_path_"+s);
			System.out.println(logFilePath);
		}
	}
	
	
	/**
	 *测试邮件接口 
	 */
	public static void testMail(){
		MailPerson ailPerson = new MailPerson("shiangzhang@tencent.com","张祥");
		//MailPerson ailPerson = new MailPerson("shiangzhang@tencent.com","张祥");
		try {
			MailUtils.sendEmail("主题1","测试<br>邮件",new MailPerson[]{ailPerson},null,/*ConfigUtil.getMSender()*/ailPerson);
			//MailUtils.sendHtmlEmail("主题2","测试<br>邮件",new MailPerson[]{ailPerson},null,ConfigUtil.getMSender());
		} catch (Exception e) {
			e.printStackTrace();
		}
		try {
			MailUtils.sendHtmlEmail("主题2","测试<br>邮件",new MailPerson[]{ailPerson},null,ConfigUtil.getMSender());
			System.out.println("mail2222222222222");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
